package org.bookie.facebook.components;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.components.ILinkComponent;
import org.apache.tapestry.engine.ILink;
import org.apache.tapestry.link.DefaultLinkRenderer;
import org.apache.tapestry.link.ILinkRenderer;

/**
 * Special version of {@link ILinkRenderer} extension of {@link DefaultLinkRenderer}
 * that renders fb:tabs
 * 
 * @author zubairov
 *
 */
public class TabItemRenderer extends DefaultLinkRenderer {

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected boolean getHasBody() {
		return false;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	protected String getElement() {
		return "fb:tab-item";
	}
	
	@Override
	protected String constructURL(ILinkComponent component, IRequestCycle cycle) {
        ILink link = component.getLink(cycle);
        return "http://apps.facebook.com" + link.getURL();
	}
}
